﻿@model List<VietPublisher.BaseProject.Models.ListBook>



@foreach (var book in Model)
{
    @*<br />
    <span>BookID:</span> @book.BookID <br />
    <span>Book Title:</span>@Html.ActionLink(@book.BookTitle, "BookView", "Home", new { bookId = book.BookID }, null) <br />
    <span>Price:</span> @book.PriceCurrent <br />
    <img alt="ddd" src="@string.Format("/Handlers/ImageHandler.ashx?fileid={0}", @book.PictureID) " />
    <br /><br /><br /><br />*@
    
    
    <div class="itemVew Clearfix">
        
        <div class="itemImg">
          @*  <a href="/Home/BookView?bookId=@book.BookID">*@
            <a href="/Book/@book.BookID">
           <img alt="ddd" src="@string.Format("/Handlers/ImageHandler.ashx?groupid={0}", @book.PictureID) " /> 
           </a>
        </div>
        <div class="itemTitle">
             @Html.ActionLink(@book.BookTitle, "BookView", "Home", new { bookId = book.BookID }, null)
        </div>
        <div class="itemPrice"> Price:<span>@book.PriceCurrent </span> </div>
          <input type="button" onclick="fnAddToCart(@book.BookID,1);"  name="btnAddToCart" value="Add To Cart" />
        
    </div>
}



<script type="text/javascript" charset="utf-8">
    function fnAddToCart(currentBookId, currentQuantity) {
        $.ajax({ type: 'GET', url: '/Home/AddToCart', data: { bookId: currentBookId, quantity: currentQuantity }, success: function (response) {
            reloadLogon();
          }
          });
      } //close function

</script>